export const getLayersHook = () => {
  let layersData = ref([]);
  let docLayer = null;
  onMounted(() => {
    docLayer = inject("$docLayer");
  });
  let docInfos = new Zondy.Catalog.MapDoc({
    docName: "guanggu",
    ip: "localhost",
    port: 6163,
  });
  docInfos.getLayersInfo((data) => {
    layersData.value = data.value;
  });
  function isShow(evt, LayerIndex) {
    docLayer.setLayerStatus(
      LayerIndex,
      evt.target.checked ? "include" : "exclude"
    );
  }
  return { isShow, layersData };
};
